package com.f6.weixin.houtai.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.f6.exceptions.BusinessException;
import com.f6.service.CommonService;
import com.f6.utils.SystemConstans;
import com.f6.vo.DBParameter;
import com.f6.weixin.vo.Dish;

@Controller
@RequestMapping(SystemConstans.HOUTAI+"/user")
public class UserController {
    private Logger logger = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private CommonService commonservice;

    
	@RequestMapping(value = "list", method = RequestMethod.GET, produces = "application/text;charset=UTF-8")
	public ModelAndView list() throws IOException, BusinessException {
	    logger.info("enter dishlist");
        ModelAndView mv = new ModelAndView();
        mv.setViewName("ht/userlist");

        Map paramap = new HashMap<String, String>();
        DBParameter dbparam = new DBParameter();
        dbparam.setAction("getAllUsers");
        dbparam.setModule("putong.User");
        dbparam.setParameter(paramap);

        List<Map<String, ?>> list = commonservice.queryMore(dbparam);
        // List<Dish> list = new ArrayList<Dish>();
        logger.info("获取列表:" + list.size());
        mv.addObject("orderlist", list);
        return mv;
	}

 

}
